package com.dcy.znoa.domain.publiz;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author pengyu  消息基表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("message")
public class Message {

    @TableId(type = IdType.AUTO, value = "mess_id")
    Long messId;

    @TableField
    String messTitle;//mess_title

    @TableField
    String message;//

    /*
1：外部短信；
2：申请（类型：请假、出差、外勤、加班、申述；外联表中类型：申请未查看、申请通过、申请不通过、申请撤销）；
3：审核（类型：请假、出差、外勤、加班、申述；外联表中类型：申请未查看、申请通过、申请不通过；申述的话，就是 1迟到 2 早退 3 地点异常）；
4：暂无
5：暂无
6：公告基础信息；
7：来访；
8、会议；
9、物业服务通知(有子类型)；
10、暂无
30：后端给WEB端的推送；
31：内部后端给APP的推送；
    * */
    @TableField
    Integer messType;//mess_type

    @TableField("is_sms")
    Integer isSms;//是否发送短信

    @TableField("entity_tbl")
    String entityTbl;

    @TableField("entity_id")
    Long entityId;//

    @TableField("send_time")
    Date sendTime;

    @TableField("create_oper_id")
    Long createOperId;

    @TableField("create_time")
    Date createTime;

    @TableField("update_oper_id")
    Long updateOperId;

    @TableField("update_time")
    Date updateTime;

    @TableField("valid_flag")
    Integer validFlag;

    @TableField(exist = false)
    String operName;

    @TableField(exist = false)
    String sendOperName;//新建消息的用户名称

    @TableField(exist = false)
    String compName;

    @TableField(exist = false)
    String depName;

    @TableField(exist = false)
    String phoneNo;

    @TableField(exist = false)
    Date receiveTime;

    @TableField(exist = false)
    Long receiveOperId; // receive_oper_id

    public Message(Long entityId,String entityTbl,String messTitle, String message, Integer messType, Integer isSms, Date sendTime, Long createOperId, Date createTime, Integer validFlag) {
        this.entityId = entityId;
        this.entityTbl = entityTbl;
        this.messTitle = messTitle;
        this.message = message;
        this.messType = messType;
        this.isSms = isSms;
        this.sendTime = sendTime;
        this.createOperId = createOperId;
        this.createTime = createTime;
        this.validFlag = validFlag;
    }
    public Message(Long entityId,String entityTbl){
        this.entityId = entityId;
        this.entityTbl = entityTbl;
    }
}
